Skip to content

Conversation

@naoNao89
Copy link
Contributor

Catches panics from cfgetospeed() on glibc 2.42. Removes .expect() and .unwrap() calls in termios handling. Suppresses panic messages.

stty now gracefully skips speed display instead of crashing.

Temporary workaround pending upstream nix fix.

Fixes #8474

before 
podman run -it --rm -v /coreutils:/workspace ubuntu:25.10 bash -c "cd /workspace && ./target/debug/stty 2>&1"
time="2025-11-25T10:05:03+07:00" level=warning msg="The input device is not a TTY. The --tty and --interactive flags might not work properly"

thread 'main' panicked at /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.30.1/src/sys/termios.rs:767:70:
called `Result::unwrap()` on an `Err` value: EINVAL
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
line = 0;
-brkint ixon -imaxbel
---
After
podman run --rm -v /coreutils:/workspace ubuntu:25.10 bash -c "
cd /workspace
apt-get update -qq >/dev/null 2>&1
apt-get install -y cargo >/dev/null 2>&1
rm -f target/debug/stty target/debug/deps/uu_stty-*
cargo build -p uu_stty 2>&1 | tail -2
echo 'TESTING:'
./target/debug/stty 2>&1 | head -3
" 2>&1
  Downloaded libc v0.2.175
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 5.19s
TESTING:
stty: Inappropriate ioctl for device

@naoNao89 naoNao89 force-pushed the fix/stty-glibc242-panic branch from 2c9b0e6 to 118d1f4 Compare November 25, 2025 08:49
@sylvestre
Copy link
Contributor

i think you committed way too many files

@oech3
Copy link
Contributor

oech3 commented Nov 25, 2025

@ChrisDryden Is this not conflicting with any your PRs?

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

@naoNao89 naoNao89 force-pushed the fix/stty-glibc242-panic branch from 118d1f4 to d15d4a1 Compare November 25, 2025 09:06
@naoNao89
Copy link
Contributor Author

😴

@naoNao89
Copy link
Contributor Author

i
forgot to unstage the docs generated when researching on the internet

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

@oech3
Copy link
Contributor

oech3 commented Nov 25, 2025

I patched your PR to main at Arch Linux. But fish: Job 1, ''/tmp/makepkg/uutils-coreutils-…' terminated by signal SIGABRT (Abort).

@oech3
Copy link
Contributor

oech3 commented Nov 25, 2025

#9483 (comment)

This project has release-{fast,small} with panic=abort.

@ChrisDryden
Copy link
Contributor

@ChrisDryden Is this not conflicting with any your PRs?

This doesn't appear to conflict with any of the open PR's should be good to go.

@naoNao89
Copy link
Contributor Author

naoNao89 commented Nov 26, 2025

i should contribute to nix instead fix the underlying API so cfgetospeed() returns Result rather than panicking. that's the real solution instead of catching panics globally. this workaround doesn't help with panic=abort anyway.

@naoNao89 naoNao89 marked this pull request as draft November 26, 2025 01:28
@oech3
Copy link
Contributor

oech3 commented Nov 26, 2025

#9483 (comment) Thankyou.

@oech3
Copy link
Contributor

oech3 commented Nov 26, 2025

#9483 (comment) nix rust-libc people are hesitating to use both of raw ioctl and versioned symbol of glibc BTW...

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

@oech3
Copy link
Contributor

oech3 commented Dec 2, 2025

@naoNao89 nix-rust/nix#2672 (comment) with help of nix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stty, glibc 2.42: panicked at termios.rs called Result::unwrap() on an Err value: EINVAL

4 participants